#include <iostream>
#include <vector>
using std::vector;
using std::cout;
using std::endl;

double calc_sum(vector<double>::const_iterator beg, vector<double>::const_iterator end)
{
	double sum = 0.0;
	while(beg != end)
	{
		sum += *beg++;
	}

	return sum;
}

int main()
{
	vector<double> dv(10, 242.22);
	cout << calc_sum(dv.begin(), dv.end()) << endl;

	return 0;
}
